#!/bin/bash
# 如果远程可以stop但是不能start。不能正常执行脚本，多半原因是因为java环境变量错误。
export JAVA_HOME=/usr/local/jdk1.8
export PATH=$JAVA_HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
nohup java -jar /home/project/SpringCloud/eureka-cluster/target/eureka-cluster-0.0.1-SNAPSHOT.jar --spring.profiles.active=peer1 -Xmx1G -Xms512M -server -XX:+UseG1GC >>/home/project/SpringCloud/eureka-cluster/eureka-server_peer1.log 2>&1 &
echo $! > /var/run/eureka-cluster_peer1.pid
nohup java -jar /home/project/SpringCloud/eureka-cluster/target/eureka-cluster-0.0.1-SNAPSHOT.jar --spring.profiles.active=peer2 -Xmx1G -Xms512M -server -XX:+UseG1GC >>/home/project/SpringCloud/eureka-cluster/eureka-server_peer2.log 2>&1 &
echo $! > /var/run/eureka-cluster_peer2.pid



